<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/base.css" media="all">
		<link rel="stylesheet" href="${pageContext.request.contextPath }/css/detail.css" />
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/styles.css" media="all">
		<script src="js/jquery.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/moment.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap-datetimepicker.js"></script>
		<title>发车页面</title>
	</head>
	<body>
		<div class="my-container">
			<div class="my-header">
				<div class="my-header-back">
					<a href="javascript:;" id="my_back"><</a>
				</div>
				<div class="my-header-title">发车页面</div>
			</div>
			<div class="my-main-add">
				<form action="/fache" method="post">
					<table class="my-add-che">
						<tr><td>车次编号:</td><td>
				
							<input type="text" name="carNumber">
							
						</td></tr>
						<tr>
							<td>发车时间:</td><td>
								<div class="iDate full">
								<input type="text" name="startTime">
								<button type="button" class="addOn"></button>
								</div>
						</td></tr>
						<tr><td>实载人数:</td><td><input type="number" name="zaiSum"></td></tr>
						<tr><td colspan="2" class="my-add-sure"><input type="submit" value="确认"/></td></tr>
					</table>
				</form>
			</div>
			<div id="my_add_msg"></div>
		</div>
	</body>
	<script type="text/javascript">
			$(document).ready(function() {
				// date time picker
				if($(".iDate.full").length > 0) {
					$(".iDate.full").datetimepicker({
						locale: "zh-cn",
						format: "YYYY-MM-DD HH:mm:ss",
						dayViewHeaderFormat: "YYYY年 MMMM"
					});
				}
				
			})
			
			document.getElementById("my_back").addEventListener("touchstart",function(){
				history.go(-1);
			})
			
			var con =$("#my_add_msg");
			$("form").submit(function(){
				var carNumber=$("input[name='carNumber']").val();
				var startTime=$("input[name='startTime']").val();
				var zaiSum=$("input[name='zaiSum']").val();
				if(carNumber==null||carNumber==undefined||carNumber==""){
					con.html("车辆编号不能为空!");
					return false;
				}
				if(startTime==null||startTime==undefined||startTime==""){
					con.html("发车时间不能为空!");
					return false;
				}
				//alert(zaiSum);
				if(zaiSum==null||zaiSum==undefined||zaiSum==""||isNaN(zaiSum)){
					con.html("车载数量不能为空!");
					return false;
				}
			});
		</script>
</html>
    